Skip to content

Conversation

@hilary-luo
Copy link
Contributor

Description

Updated all examples for positions that work in the warehouse world and added 2 examples:

Patrol example: Drives in a loop forever while monitoring battery charge. If the battery charge goes low then it will return to the base to charge.

Mail delivery example: Has a list of possible endpoints that are able to be selected from the user interface. The robot will be sent to the selected location.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Each tutorial was launched and run in the warehouse world.

# Start the humble sim
ros2 launch turtlebot4_ignition_bringup turtlebot4_ignition.launch.py rviz:=true nav2:=true localization:=true

# Select the line for the desired tutorial, the following are the new ones
ros2 run turtlebot4_python_tutorials patrol_loop 
ros2 run turtlebot4_python_tutorials mail_delivery

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

The documentation update has been drafted but is pending this code review.

@hilary-luo hilary-luo requested a review from roni-kreinin as a code owner May 2, 2023 18:56
# Subscribe to the /battery_state topic
self.battery_state_subscriber = self.create_subscription(
BatteryState,
'/battery_state',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use global namespace here.

sleep(15)
with lock:
battery_percent = battery_monitor.battery_percent
print(f'Battery is at {(battery_percent*100):.2f}% charge', end='\r')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use navigator.info instead of print.


from operator import itemgetter

from pick import pick
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a default python3 package. Let's avoid it and use input() instead.

@roni-kreinin roni-kreinin merged commit 338aee6 into humble May 17, 2023
@hilary-luo hilary-luo deleted the hilary-luo/warehouse-world branch July 4, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants